<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Customer Transaction Detail</title>
	
		<link rel="stylesheet" href="<c:url value="css/bootstrap.min.css" />"
			type="text/css" />
		<link rel="stylesheet"
			href="<c:url value="font-awesome-4.2.0/css/font-awesome.min.css" />"
			type="text/css" />
		<link rel="stylesheet"
			href="<c:url value="css/jquery.dataTables.css" />" type="text/css" />
		<link rel="stylesheet"
			href="<c:url value="css/style.css" />" type="text/css" />
		<link rel="stylesheet"
			href="<c:url value="css/animate.css" />" type="text/css" />
		<script src="<c:url value="js/jquery/jquery.min.js" />"
			type="text/javascript"></script>
		<script src="<c:url value="js/jquery/jquery-ui.js" />"
			type="text/javascript"></script>
		<script src="<c:url value="js/jquery/jquery.dataTables.js" />"
			type="text/javascript"></script>
		<script>
			$(document).ready(function() {
				$("#mytable").dataTable();
			});
		</script>
	</head>
	<body class="container-fluid">
		<header class="row">
			<div id="logocontainer" class="col-md-2">
				<img src="images/logo.png"/>		
			</div>
			<div class="col-md-10 status-container">
				<h1 class="welcomeMessage">Welcome user</h1>
			</div>
			<div class="bg-trees"></div>
		</header>
		<section class="row">
			<div id="bodycontainer" class="col-md-11">
				<div class="col-md-12 text-center">
					<h2 class="headerMessage">Transaction id: ${transactionDetail.transactionId}</h2>
				</div>
				<div class="col-md-6">
					<div class="group-panel clearfix form-group">
						<label class="header">From</label>
						<table class="table">
							<tr>
								<td>Account ID</td>
								<td>${transactionDetail.sendCustomer.accountNumber}	</td>
							</tr>
							<tr>
								<td>Account holder</td>
								<td>${transactionDetail.sendCustomer.firstName} ${transactionDetail.sendCustomer.lastName}</td>
							</tr>
							<tr>
								<td>Balance Amount</td>
								<td><fmt:formatNumber type="number" maxFractionDigits="3" value="${transactionDetail.sendCustomer.amount}" /> (VND)</td>
							</tr>
						</table>
					</div>
					<div>Transfer Amount: <label><fmt:formatNumber type="number" maxFractionDigits="3" value="${transactionDetail.amount}" /> (VND)</label></div>
				</div>
				<div class="col-md-6">
					<div class="group-panel clearfix form-group">
						<label class="header">To</label>
						<table class="table">
							<tr>
								<td>Account ID</td>
								<td>${transactionDetail.receivedCustomer.accountNumber}</td>
							</tr>
							<tr>
								<td>Account holder</td>
								<td>${transactionDetail.receivedCustomer.firstName} ${transactionDetail.receivedCustomer.lastName}</td>
							</tr>
							<tr>
								<td>Account state</td>
								<td>
									<c:choose>
									<c:when test="${transactionDetail.receivedCustomer.active == true}">
										Active
									</c:when>
									<c:otherwise>
										Deactive
									</c:otherwise>
								</c:choose>
								</td>
							</tr>
						</table>
					</div>
					<div>Transaction state: <label class="${transactionDetail.transactionState.stateDescription}">${transactionDetail.transactionState.stateDescription}</label></div>
				</div>
				<div class="col-md-12">
					<form method="post">
						<h3>Comment</h3>
						<textarea rows="7" cols="500" class="form-control" name="reason"></textarea>
						<hr class="clearfix">
						<div class="text-center clearfix">
							<input type="hidden" name="transactionId" value="${transactionDetail.transactionId}"/>
							<input type="submit" formaction="aproveTransaction" class="btn btn-success" value="Approve">
							<input type="submit" formaction="denyTransaction" class="btn btn-danger" value="Deny">
							<a href="adminTransactionHistory" class="btn btn-primary">Cancel</a>
						</div>
					</form>
				</div>
			</div>
			<%@include file="admin_menu.jsp" %>
		</section>
		<footer>
			cdc_bank@csc.com
		</footer>
	</body>
</html>